import { NestFactory } from "@nestjs/core";
import { AppModule } from "./app.module";
import * as process from "process";

async function bootstrap() {
  const app = await NestFactory.create(AppModule, {
    logger: ["error", "warn", "log"]
  });
  // 全局开启跨域
  app.enableCors({
    origin: true,
    credentials: true,
    methods: "GET,POST,PUT,DELETE",
    allowedHeaders: "*",
    exposedHeaders: "*"
  });
  await app.listen(process.env.PORT ?? 3000);
}

bootstrap();
